#include <iostream>

using namespace std;
template <class T,class T1>
class Produce //商品  模板类
{
public:
	Produce(T _price,float _cost,T1 _name)
	{
		price=_price;
		cost=_cost;
		name=_name;
	}
	void getPrice()
	{
		cout<<price<<"  "<<name<<endl;
	}
private:
	T price;
	T1 name;
	float cost;
};


int main()
{
	string str="洗发水";
	//使用模板类定义一个对象
	//Produce<float,string> pro(7.5,2.5,str);
	
	Produce<int,string> pro(7.5,2.5,str);
	pro.getPrice();
}